      -- SetItems.lua  Rewrite for PR v0.9
	  -- Revision 1.0 by Kel. Last update 07.23.08
      -- To do: remove set names duplcation to clean up the list.
      -- 		Add each item's item type, so people can tell what's what.


table.insert(itemActions,
      -- SET items (all)
   function(item, action)
      if item.quality ~= ItemQuality.Set then
         return false
      end
      
      return processItemList(item, action, setItems)
   end
)

-- NOTE : All set items using identical itemtypes are removed from the main list
-- 		  and are handled in groups at the bottom of this file 

-- see: dir .. "readme.txt" for information regarding itemLists
-- Thanks Craz1 and versatil for catching some unhandled itemtypes!

-- To pick a set item, uncomment the entry and change the priority from 1-10.  10 = highest priority.
-- If you comment out an entry, set it's priority to 1 to be safe.

setItems = {
   --{"xtb", 3, false}, -- Aldur's Watchtower Aldur's Advance - Battle Boots
   --{"uul", 4, false}, -- Aldur's Watchtower Aldur's Deception - Shadow Plate
   --{"9mt", 5, false}, -- Aldur's Watchtower Aldur's Rhythm
   --{"dr8", 1, false}, -- Aldur's Watchtower Aldur's Stony Gaze
   --{"rng", 1, false}, -- Angelic Raiment Angelic Mantle  - Ring Mail
   --{"sbr", 1, false}, -- Angelic Raiment Angelic Sickle - Sabre
   --					-- Angelic Raiment Angelic Halo :  See Rings Section
   --					-- Angelic Raiment Angelic Wings : See Amulets Section
   --{"wst", 1, false}, -- Arcanna's Tricks Arcanna's Deathwand
   --{"ltp", 1, false}, -- Arcanna's Tricks Arcanna's Flesh
   --{"skp", 1, false}, -- Arcanna's Tricks Arcanna's Head
   --					-- Arcanna's Tricks Arcanna's Sign: See Amulets Section
   --{"vbl", 1, false}, -- Arctic Gear Arctic Binding
   --{"qui", 1, false}, -- Arctic Gear Arctic Furs
   --{"swb", 1, false}, -- Arctic Gear Arctic Horn
   --					-- Arctic Gear Arctic Mitts : See Light Gauntlets Section
   --{"2ax", 1, false}, -- Berserker's Arsenal Berserker's Hatchet
   --{"spl", 1, false}, -- Berserker's Arsenal Berserker's Hauberk
   --{"hlm", 1, false}, -- Berserker's Arsenal Berserker's Headgear
   --{"7gd", 1, false}, -- Bul-Kathos' Children Bul-Kathos' Sacred Charge
   --{"7wd", 1, false}, -- Bul-Kathos' Children Bul-Kathos' Tribal Guardian
   --{"chn", 1, false}, -- Cathan's Traps Cathan's Mesh
   --{"bst", 1, false}, -- Cathan's Traps Cathan's Rule
   --{"msk", 1, false}, -- Cathan's Traps Cathan's Visage
   --					-- Cathan's Traps Cathan's Sigil: See Amulets Section
   --					-- Cathan's Traps Cathan's Seal: See Rings Section 
   --{"gsc", 1, false}, -- Civerb's Vestments Civerb's Cudgel - Grand Scepter
   --{"lrg", 1, false}, -- Civerb's Vestments Civerb's Ward
   --					-- Civerb's Vestments Civerb's Icon: See Amulets Section
   --{"sml", 1, false}, -- Cleglaw's Brace Cleglaw's Claw
   --{"mgl", 1, false}, -- Cleglaw's Brace Cleglaw's Pincers
   --{"lsd", 1, false}, -- Cleglaw's Brace Cleglaw's Tooth - Long sword
   --{"stu", 1, false}, -- Cow King's Leathers Cow King's Hide - Studded Leather
   --{"xap", 1, false}, -- Cow King's Leathers Cow King's Horns - War Hat
   -- 				  -- Cow King's Leathers Cow King's Hooves: See Boots Section		
   --{"lbl", 1, false}, -- Death's Disguise Death's Guard
   --{"lgl", 1, false}, -- Death's Disguise Death's Hand
   --{"wsd", 1, false}, -- Death's Disguise Death's Touch
   --{"xar", 1, false}, -- Griswold's Legacy Griswold's Heart - Ornate Armor
   {"paf", 7, false}, -- Griswold's Legacy Griswold's Honor - Vortex Shield
   {"7ws", 7, false}, -- Griswold's Legacy Griswold's Redemption - Caduceus
   {"urn", 7, false}, -- Griswold's Legacy Griswold's Valor - Corona
   --{"7ma", 1, false}, -- Heaven's Brethren Dangoon's Teaching
   --{"xrs", 1, false}, -- Heaven's Brethren Haemosu's Adamant
   --{"uhm", 1, false}, -- Heaven's Brethren Ondal's Almighty
   --{"uts", 1, false}, -- Heaven's Brethren Taebaek's Glory
   --{"buc", 1, false}, -- Hsarus' Defense Hsarus' Iron Fist
   --{"mbt", 1, false}, -- Hsarus' Defense Hsarus' Iron Heel
   --					-- Hsarus' Defense Hsarus' Iron Stay :  See Belts Section
   --					-- Hwanin's Majesty Hwanin's Blessing : See Belts Section
   --{"9vo", 1, false}, -- Hwanin's Majesty Hwanin's Justice
   --{"xcl", 1, false}, -- Hwanin's Majesty Hwanin's Refuge
   --{"xrn", 1, false}, -- Hwanin's Majesty Hwanin's Splendor
   --{"zhb", 1, false}, -- Immortal King Immortal King's Detail
   --{"xhg", 1, false}, -- Immortal King Immortal King's Forge
   --{"xhb", 1, false}, -- Immortal King Immortal King's Pillar
   {"uar", 7, false}, -- Immortal King Immortal King's Soul Cage
   --{"7m7", 1, false}, -- Immortal King Immortal King's Stone Crusher
   --{"ba5", 1, false}, -- Immortal King Immortal King's Will
   --{"gwn", 1, false}, -- Infernal Tools Infernal Torch
   -- 					-- Infernal Tools Infernal Cranium : See Cap Section
   --					-- Infernal Tools Infernal Sign :    See Heavy Belt Section
   --					-- Iratha's Finery Iratha's Coil :   See Crowns Section
   --					-- Iratha's Finery Iratha's Collar : See Amulets Section
   --					-- Iratha's Finery Iratha's Cord :   See Heavy Belt Section
   --					-- Iratha's Finery Iratha's Cuff :   See Light Gauntlets Section
   --{"brs", 1, false}, -- Isenhart's Armory Isenhart's Case
   --{"fhl", 1, false}, -- Isenhart's Armory Isenhart's Horns
   --{"bsd", 1, false}, -- Isenhart's Armory Isenhart's Lightbrand
   --{"gts", 1, false}, -- Isenhart's Armory Isenhart's Parry
   --{"amc", 1, false}, -- M'avina's Battle Hymn M'avina's Caster
   --{"uld", 1, false}, -- M'avina's Battle Hymn M'avina's Embrace
   --{"xtg", 1, false}, -- M'avina's Battle Hymn M'avina's Icy Clutch
   --{"zvb", 1, false}, -- M'avina's Battle Hymn M'avina's Tenet
   {"ci3", 7, false}, -- M'avina's Battle Hymn M'avina's True Sight
   --{"kit", 1, false}, -- Milabrega's Regalia Milabrega's Orb
   --{"aar", 1, false}, -- Milabrega's Regalia Milabrega's Robe
   --{"wsp", 1, false}, -- Milabrega's Regalia Milabrega's Rod
   -- 					-- Milabrega's Diadem - See Crowns Section
   --{"ci0", 1, false}, -- Naj's Ancient Vestige Naj's Circlet   - Circlet
   --{"ult", 1, false}, -- Naj's Ancient Vestige Naj's Light Plate - Hellforge Plate
   --{"6cs", 1, false}, -- Naj's Ancient Vestige Naj's Puzzler - Elder Staff
   {"7qr", 7, false}, -- Natalya's Odium Natalya's Mark      - Scissors Suwayyah
   --{"ucl", 4, false}, -- Natalya's Odium Natalya's Shadow  - Loricated Mail
   --{"xmb", 4, false}, -- Natalya's Odium Natalya's Soul      - Mesh Boots
   --{"xh9", 5, false}, -- Natalya's Odium Natalya's Totem   - Grim Helm
   --{"xhm", 3, false}, -- Orphan's Call Guillaume's Face      - Winged Helm
   --{"xvg", 1, false}, -- Orphan's Call Magnus' Skin        - Sharkskin Gloves
   --{"xml", 1, false}, -- Orphan's Call Whitstan's Guard    - Round Shield
   --{"ztb", 1, false}, -- Orphan's Call Wilhelm's Pride 	     - Battle Belt
   -- 					-- Sander's Folly Sander's Paragon : See Cap Section
   --					-- Sander's Folly Sander's Riprap : See Boots Section 	
   --{"bwn", 1, false}, -- Sander's Folly Sander's Superstition
   --{"vgl", 1, false}, -- Sander's Folly Sander's Taboo
   --{"7ls", 1, false}, -- Sazabi's Grand Tribute Sazabi's Cobalt Redeemer
   --{"upl", 4, false}, -- Sazabi's Grand Tribute Sazabi's Ghost Liberator
   --{"xhl", 1, false}, -- Sazabi's Grand Tribute Sazabi's Mental Sheath
   --{"hgl", 1, false}, -- Sigon's Complete Steel Sigon's Gage
   --{"tow", 1, false}, -- Sigon's Complete Steel Sigon's Guard
   --{"hbt", 1, false}, -- Sigon's Complete Steel Sigon's Sabot
   --{"gth", 1, false}, -- Sigon's Complete Steel Sigon's Shelter
   --{"ghm", 1, false}, -- Sigon's Complete Steel Sigon's Visor
   --{"hbl", 1, false}, -- Sigon's Complete Steel Sigon's Wrap
   --				  -- Tal Rasha's Wrappings Tal Rasha's Adjudication : See Amulets Section
   --{"zmb", 1, false}, -- Tal Rasha's Wrappings Tal Rasha's Fine-Spun Cloth - Mesh Belt
   {"uth", 8, false}, -- Tal Rasha's Wrappings Tal Rasha's Guardianship - Lacquered Plate
   --{"xsk", 1, false}, -- Tal Rasha's Wrappings Tal Rasha's Horadric Crest - Death Mask
   --{"oba", 8, false}, -- Tal Rasha's Wrappings Tal Rasha's Lidless Eye - Swirling Crystal
   --{"mpi", 1, false}, -- Tancred's Battlegear Tancred's Crowbill
   --{"lbt", 1, false}, -- Tancred's Battlegear Tancred's Hobnails
   --{"bhm", 1, false}, -- Tancred's Battlegear Tancred's Skull
   --{"ful", 1, false}, -- Tancred's Battlegear Tancred's Spine
   --					-- Tancred's Battlegear Tancred's Weird : See Amulets Section   
   --{"umc", 1, false}, -- The Disciple Credendum
   --{"uui", 1, false}, -- The Disciple Dark Adherent
   --{"ulg", 1, false}, -- The Disciple Laying of Hands
   --{"xlb", 1, false}, -- The Disciple Rite of Passage
   --{"xmg", 1, false}, -- Trang-Oul's Avatar Trang-Oul's Claws
   --{"utc", 7, false}, -- Trang-Oul's Avatar Trang-Oul's Girth
   --{"uh9", 7, false}, -- Trang-Oul's Avatar Trang-Oul's Guise
   --{"xul", 7, false}, -- Trang-Oul's Avatar Trang-Oul's Scales
   --{"ne9", 7, false}, -- Trang-Oul's Avatar Trang-Oul's Wing
   --{"lea", 1, false}, -- Vidala's Rig Vidala's Ambush - Leather Armor
   --{"lbb", 1, false}, -- Vidala's Rig Vidala's Barb - Long Bow
   --{"tbt", 1, false}, -- Vidala's Rig Vidala's Fetlock - Light Plated Boots
   -- 					-- Vidala's Rig Vidala's Amulet : See Amulets Section 


--[[ 
	 		SET ITEMS WITH IDENTICAL ITEMTYPES

	 Below we process Set pieces that have the same itemtypes by checking their SetItem ID code 
	 Ex: Set amulets all are itemcode "amu" so we need a way to tell them apart.
 
	 To pick a specific item, set the priority from 1-10 AND change that item's return to: return true
	 To NOT pick that specific item, set the item's return to return false
	 To not pick ANY items in the group, set each item's to: return false AND set the group's priority to 0

	 NOTE: For bot to check the ID, Identify MUST be true for that rule
	 If identify is false, all set items in that group will be stashed UnID
	 Identify True example:  {"amu", 7, true,
	 Identify False example: {"amu", 7, false,						  ]]--


-- Set Amulets
    {"amu", 7, true, -- Vidala, Angelic, Arcannas, Cathans, Civerbs, Irathas, Tals, Tancreds, Disciple
      function(item)
         if (item.flags.Identified) then
            if (item.setItem.Index == 77) then        -- Tal Rasha's Adjudication
               return true
            elseif (item.setItem.Index == 20) then    -- Vidala's Snare
               return false
            elseif (item.setItem.Index == 53) then    -- Angelic Wings
               return false
            elseif (item.setItem.Index == 58) then    -- Arcanna's Sign
               return false
            elseif (item.setItem.Index == 28) then    -- Cathan's Sigil
               return false
            elseif (item.setItem.Index == 1) then     -- Civerb's Icon
               return false
            elseif (item.setItem.Index == 9) then     -- Iratha's Collar
               return false
            elseif (item.setItem.Index == 33) then    -- Tancred's Weird
               return false
            elseif (item.setItem.Index == 95) then    -- Telling of Beads
               return false
            end
            return false -- don't keep any item not in this list
         end

         return true -- if identify above is set to false, true stashes item UnID
      end
   },

-- Set Caps   
   {"cap", 0, true, -- Sanders's Paragon or Infernal Cranium -- note: 0 priority-> don't pick
      function(item)
         if (item.flags.Identified) then
            if (item.setItem.Index == 41) then      -- Infernal Cranium
               return false
            elseif (item.setItem.Index == 123) then   -- Sander's Paragon
               return false -- true keeps item, false doesn't
            end
            return false -- don't keep items not in this list
         end
   
         return true -- keep if unid (for pickup)
      end
   },

-- Set Crowns
   {"crn", 0, true, -- Iratha's Coil or Milabrega's Diadem Crown -- note: 0 priority-> don't pick
      function(item)
         if (item.flags.Identified) then
            if (item.setItem.Index == 11) then      -- Iratha's Coil
               return false
            elseif (item.setItem.Index == 23) then   -- Milabrega's Diadem
               return false
            end
            return false -- don't keep items not in this list
         end
   
         return true -- keep if unid (for pickup)
      end
   },

-- Set Belts
   {"mbl", 0, true, -- Hsaru's Iron Stay or Hwanin's Blessing Belt -- note: 0 priority-> don't pick
      function(item)
         if (item.flags.Identified) then
            if (item.setItem.Index == 5) then      -- Hsaru's Iron Stay
               return false
            elseif (item.setItem.Index == 110) then   -- Hwanin's Majesty Hwanin's Blessing
               return false
            end
            return false -- don't keep item not on this list
         end
   
         return true -- keep if unid (for pickup)
      end
   },

   -- Light Gauntlets
   {"tgl", 0, true, -- Arctic Mitts or Iratha's Cuff -- note: 0 priority->nopick
      function(item)
         if (item.flags.Identified) then
            if (item.setItem.Index == 10) then      -- Iratha's Cuff
               return false
            elseif (item.setItem.Index == 57) then   -- Arctic Mitts
               return false
            end
            return false -- don't keep item not in this list
         end
   
         return true -- keep if unid (for pickup)
      end
   },   


-- Set Heavy Belts
   {"tbl", 0, true, -- Infernal Sign or Iratha's Cord -- note: 0 priority->don't pick
      function(item)
         if (item.flags.Identified) then
            if (item.setItem.Index == 12) then      -- Iratha's Cord
               return false -- true keepss item, false doesn't
            elseif (item.setItem.Index == 43) then   -- Infernal Sign
               return false
            end
            return false -- don't keep items not in this list
         end
   
         return true -- keep if unid (for pickup)
      end
   },
   
-- Set Heavy Boots
   {"vbt", 0, true, -- Cow King's Hooves, Sander's Riprap -- note: 0 priority->don't pick
      function(item)
         if (item.flags.Identified) then
            if (item.setItem.Index == 124) then         -- Sander's Riprap
               return false
            elseif (item.setItem.Index == 119) then   -- Cow King's Hooves
               return true
            end
            return false -- don't keep items not in this list
         end
         return true -- keep if unid (for pickup)
      end
   },

-- Set Rings
   {"rin", 0, true, -- Angelic, Cathan's -- note: 0 priority-> don't pick
      function(item)
         if (item.flags.Identified) then
            if (item.setItem.Index == 29) then      -- Cathan's Seal
               return false
            elseif (item.setItem.Index == 52) then   -- Angelic Halo
               return false
            end
            return false -- don't keep items not in this list
         end
   
         return true -- keep if unid (for pickup)
      end
   }



}